package graphe;

public class Arete 
{
	private int id;
	private Sommet summit1, summit2;
	private Graphe myGraph;
	protected String dynamicType = "Arete";
	
	
	public Arete(Sommet summit1, Sommet summit2)
	{
		try {
			
			if (summit1.myGraph != summit2.myGraph)
				throw new Exception();
			
			this.summit1 = summit1;
			this.summit2 = summit2;
			
			myGraph = summit1.myGraph;
			
			id = myGraph.nombreArete() + 1;
			
			summit1.ajouter(this);
			summit2.ajouter(this);
		} 
		catch (Exception e){e.printStackTrace();}	
	}
	
	
	
	



	public String getDynamicType() {
		return dynamicType;
	}



	public void setDynamicType(String dynamicType) {
		this.dynamicType = dynamicType;
	}
	
	
	
}
